<%@ page contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ include file="/WEB-INF/jsp/includes/common.jsp"%>
<html>
	<head>
	 	<%@ include file="/WEB-INF/jsp/includes/head.jsp"%>
		<link type="text/css" href="${ctx }/css/jqueryui/jquery.ptTimeSelect.css" rel="stylesheet" />
		<!--[if IE]>
   			<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
		<![endif]-->
		<script type="text/javascript" src="${ctx }/js/lib/jquery.ptTimeSelect.js"></script>
		<script type="text/javascript" src="${ctx }/js/lib/jquery.validate.js"></script>
		<script type="text/javascript" src="${ctx }/js/lib/jquery.validate.messages_cn.js"></script>
		<script type="text/javascript" src="${ctx }/js/base/validateinfo.js"></script>
		<script type="text/javascript" src="${ctx }/js/award/awardconfigchance.js"></script>
	</head>
	<body>
		<%@ include file="/WEB-INF/jsp/includes/logo.jsp"%>
		<div class="container">
			<div class="main clearfix">
				<%@ include file="/WEB-INF/jsp/includes/nav.jsp"%>
				<div class="container2 fl">
					<div class="main">
						<h4 class="mb10"><span><a href="${ctx }/activity/index.do">活动列表</a>&nbsp;>&nbsp;</span><span><a href="${ctx }/award/index.do?activeId=${activeId}">活动奖品</a>&nbsp;>&nbsp;</span><span class="fb">设置概率</span></h4>
						<div class="content-wraper">
						<form action="${ctx }/award/saveAwardConfigChance.do" id="addsavrAwardConfigChanceForm"  method="post">
						<p class="validate-tips">${error }</p>
						<input type="hidden" name="awardId" id="awardId" value="${award.id }"></input>
						<input type="hidden" name="activeId" id="activeId" value="${activeId}"></input>
							<section class="award-chance">
								<div class="content">
									<div class="item">
										<label id="appointUser">
											<span>指定用户中奖：</span>
										</label>
										<div class="award-user-wraper">
											<div class="hd mt10 clearfix">
												<c:if test="${actFaceStatus==1 or actFaceStatus==4 }">
													<a href="javascript:void(0);" id="addAssignWinner" class="add-award-user-link btn btn1 fl">添加中奖用户</a>
												</c:if>
											</div>
											<div class="cont mt10">
												<table cellspacing="0" border="1">
													<thead>
														<tr>
															<th width="50">序号</th>
															<th width="240">用户名</th>
															<th width="120">数量</th>
															<th width="120">操作</th>
														</tr>
													</thead>
													<tbody>
														
														<c:forEach var="item" items="${assignedWinnerList }">
															<c:if test="${DATALIST_CURRENTROW%2==0 }">
																<tr class="odd">
															</c:if>
															<c:if test="${DATALIST_CURRENTROW%2==1 }">
																<tr class="even">
															</c:if>
															<td>${item.id}</td>
															<td>${item.passport}</td>
															<td>${item.maxNum }</td>
															<td><c:if test="${actFaceStatus==1 or actFaceStatus==4 }"><a href="javascript:void(0);" class="is-delete">删除</a></c:if></td>
																</tr>
														</c:forEach>
														
													</tbody>
												</table>
											</div>
										</div>
									</div>
									<div class="clearfix item" >
										<label>
											<input type="checkbox" id="probabilityCheckBox" name="probabilityCheckBox" <c:if test="${award.winType==3 or award.winType==2}">checked</c:if>/>
											<span>概率中奖：</span>
										</label>
									</div>
									<div class="item">
									<label>已添加的尾数： </label>
									<c:forEach var="item" items="${numWins }">
									<span>${item }</span>
									</c:forEach>
									</div>
									
									
										<div class="item">
											<label>
												<input type="radio" name="prizeRadio" id="prizeNumRadio"  value="3" <c:if test="${award.winType==3 }">checked</c:if> />
												<span>尾数中奖：</span>
											</label>
											
											<input id="prizeNumInput" name="prizeNumInput" type="text" value="<c:if test="${award.winType==3 }">${award.numWin }</c:if>"/>
											<span style="color: red;">同一活动不能有相同尾数</span>
										</div>
										<div class="item clearfix">
											<label>
												<input type="radio" name="prizeRadio" id="prizeTimeRadio" value="2" <c:if test="${award.winType==2 }">checked</c:if>/>
												<span>时间中奖：</span>
											</label>
												<span ><input type="button" id="addTime" value="添加时间" class="btn btn1 fl" /></span>
											<div class="datetime fl pl10">
												<c:if test="${timeWinList==null }">
													<p>
													<span>中奖时间：</span>
													<input type="text" class="timepicker"  />
													<input type="button" class="delete-time" value="删除"></span>
													</p>
												</c:if>
												<c:forEach var="item" items="${timeWinList }">
													<p>
													<span>中奖时间：</span>
													<input type="text" class="timepicker" value="${item }"/>
													<input type="button" class="delete-time" value="删除"></span>
													</p>
												</c:forEach>
												<input type="hidden" id="timeHidden" name="timeHidden"></input>
											</div>
										</div>
								</div>
							</section>
							<div class="oper-row mt20">
								<c:if test="${actFaceStatus==1 or actFaceStatus==4 }">
									<input type="button" id="addAwardConfigButton" name="addAwardConfigButton" class="btn-save btn btn2 none-underline" value="保存"/>
									<input type="button" class="btn-cancel btn btn3 none-underline" onclick="window.location.href='${ctx }/award/index.do?activeId=${activeId }'" value="取消"/>
								</c:if>
							</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 弹出层 -->
		<!-- 添加中奖用户 -->
		<div id="addAwardUser" title="添加中奖用户" class="hidden">
			<form action="" method="">
				<fieldset>
					<p class="validate-tips hidden"></p>
					<p class="item">
						<label for="username"><i>*</i>通行证：</label>
						<input type="text" name="username" id="username" placeholder="请输入通行证" class="text ui-widget-content ui-corner-all" />
					</p>
					<p class="item">
						<label for="num"><i>*</i>数量：</label>
						<input type="text" name="num" id="num" placeholder="请输入数量" class="text ui-widget-content ui-corner-all" />
					</p>
				</fieldset>
			</form>
		</div>
	</body>
</html>


